Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Extract correct values for user email and use configuration property for user displayed name #11351

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

pnartowski
Copy link

@pnartowski pnartowski commented Jan 27, 2025

Extract user email from authentication token, use configuration property to define displayed user name.

Fix # When using oauth2 or optional_oauth2 random UUID is displayed instead of user email or full name.

Describe changes proposed in this pull request:

  • for oauth2 authentication extract email from Principal class
  • use configuration property skin.user_display_name to define what value should be show for user name, this property was already defined but never used

Checks

Any screenshots or GIFs?

If this is a new visual feature please add a before/after screenshot or gif
here with e.g. Giphy CAPTURE or Peek

Notify reviewers

Read our Pull request merging
policy
. It can help to figure out who worked on the
file before you. Please use git blame <filename> to determine that
and notify them either through slack or by assigning them as a reviewer on the PR

cbioportal-before

to

cbioportal-after

@pnartowski
Copy link
Author

@dippindots @inodb @arishta may I ask you to review my PR ?

@inodb inodb requested a review from haynescd January 27, 2025 22:40
@haynescd
Copy link
Collaborator

haynescd commented Feb 4, 2025

I think we need some more clarification. There is no bug right now?

the app does display the email?

Are you suggesting a feature change to configure the display name?

This is already a feature within Spring Security
To fix this you would just set the following property
spring.security.oauth2.client.provider.google.user-name-attribute=email

image

@pnartowski
Copy link
Author

I didn't report bug for it.
Property which you have in application.properties.EXAMPLE skin.user_display_name wasn't used in code and there was TODO in code which pointed to make it usable in future, that's why my change proposition.
I didn't know property spring.security.oauth2.client.provider.google.user-name-attribute=name and it works for me so its up to you if you need my modification.

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants